<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>css 三角制作</title>
    <style>
      .box1 {
        width: 0;
        height: 0;
        /* border: 10px solid pink; */
        border-top: 100px solid pink;
        border-right: 100px solid red;
        border-left: 100px solid blue;
        border-bottom: 100px solid green;
        margin-bottom: 10px;
      }

      /* 下三角 */
      .box2 {
        width: 0;
        height: 0;
        border: 100px solid transparent;
        border-top-color: pink;
        margin-bottom: 10px;
      }

      /* 上三角 */
      .box3 {
        width: 0;
        height: 0;
        border: 50px solid transparent;
        border-bottom-color: pink;
        margin-bottom: 10px;
      }

      /* 左三角 */
      .box4 {
        width: 0;
        height: 0;
        border: 80px solid transparent;
        border-left-color: pink;
        margin-bottom: 10px;
      }

      /* 右三角 */
      .box5 {
        width: 0;
        height: 0;
        border: 30px solid transparent;
        border-right-color: pink;
        margin-bottom: 10px;
      }

      /* 京东三角 */
      .jd {
        position: relative;
        width: 120px;
        height: 249px;
        background-color: pink;
      }

      .jd span {
        position: absolute;
        right: 15px;
        top: -10px;
        width: 0;
        height: 0;
        /* 为了照顾兼容性 */
        line-height: 0;
        font-size: 0;
        border: 5px solid transparent;
        border-bottom-color: pink;
      }
    </style>
  </head>
  <body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div>

    <!-- 京东三角案例 -->
    <div class="jd">
      <span></span>
    </div>
  </body>
</html>
